<?php

namespace App\Http\Requests\Admin\GameTool;

use App\Models\Enum\MailType;
use Illuminate\Foundation\Http\FormRequest;

//添加批量充值 请求验证
class RechargelBatchCreateRequest extends FormRequest
{
    public function __construct()
    {

    }

    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        $rules = [
            'channel_id' => 'required',
            'reason' => 'required',
            'attachment' => 'required|mimes:csv,txt'
        ];

        return $rules;
    }

    public function messages()
    {
        return [
            'channel_id.required' => '渠道不能为空',
            'reason.required' => '发放理由不能为空',

            'attachment.required' => '附件不能为空',
            'attachment.mimes' => '必须上传csv格式的文件',
        ];
    }

    protected function prepareForValidation()
    {

    }
}
